
import BackendjsFunctions from '@/core/BackendjsFunctions.js'
import { backendjsFunctions } from '@/core/functions.js'

export default {
  /**
   * 对页面头部区域容器的设置
   * @param {*} bjContainerCustom bjContainerCustom 即传入到头部编辑区域的数据，其中 bjContainerCustom._other._tmpId 为识别主容器标识
   * @returns
   */
  setCustomContainerCustom (bjContainerCustom) {
    BackendjsFunctions._verification('setCustomContainerCustom')
    try {
      return backendjsFunctions().setCustomContainerCustom(bjContainerCustom)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
  * 在页面的头部区域对主容器增加栅格
  * form : {
      position: number 增加位置 -1 顶部 , -2 底部
      girdtype: 栅格 col 对应的参数
      col: number多少列
      parentBoxTmpId: 对应的添加父级容器临时ID
    }
  */
  addCustomContainerCustomcol (form) {
    BackendjsFunctions._verification('addCustomContainerCustomcol')
    try {
      return backendjsFunctions().addCustomContainerCustomcol(form)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
   * 头部区域栅格中增加容器
   * tmpParentId 栅格的 tmpId
   * position 增加的位置 -1 最左边 -2 最右边
   */
  addContainerCustombox (tmpParentId, position) {
    BackendjsFunctions._verification('addContainerCustombox')
    try {
      return backendjsFunctions().addContainerCustombox(tmpParentId, position)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 头部容器中嵌套栅格
    * tmpParentId 父级容器的 tmpId
    * row 行数
    * col 列数
    * position 增加的位置 -1 最左边 -2 最右边
    * girdtype 栅格 col 对应的参数
    */
  addContainerCustomcol (tmpParentId, row, col, position, girdtype) {
    BackendjsFunctions._verification('addContainerCustomcol')
    try {
      return backendjsFunctions().addContainerCustomcol(tmpParentId, row, col, position, girdtype)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 设置 Custombox
    */
  setContainerCustombox (bjContainer) {
    BackendjsFunctions._verification('setContainerCustombox')
    try {
      return backendjsFunctions().setContainerCustombox(bjContainer)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 设置 Customcol
    */
  setContainerCustomcol (bjContainer) {
    BackendjsFunctions._verification('setContainerCustomcol')
    try {
      return backendjsFunctions().setContainerCustomcol(bjContainer)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 删除 Custombox
    */
  delContainerCustombox (tmpContainerCustomboxId) {
    BackendjsFunctions._verification('delContainerCustombox')
    try {
      return backendjsFunctions().delContainerCustombox(tmpContainerCustomboxId)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
   * 删除 Customcol
   */
  delContainerCustomcol (tmpContainerCustomcolId) {
    BackendjsFunctions._verification('delContainerCustomcol')
    try {
      return backendjsFunctions().delContainerCustomcol(tmpContainerCustomcolId)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 是否可以被删除
    */
  isDelContainerCustomColBox (tmpId) {
    BackendjsFunctions._verification('isDelContainerCustomColBox')
    try {
      return backendjsFunctions().isDelContainerCustomColBox(tmpId)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * Custombox 排序
    */
  sortContainerCustombox (rltdatalist) {
    BackendjsFunctions._verification('sortContainerCustombox')
    try {
      return backendjsFunctions().sortContainerCustombox(rltdatalist)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
  * Customcol 排序
  */
  sortContainerCustomcol (rltdatalist) {
    BackendjsFunctions._verification('sortContainerCustomcol')
    try {
      return backendjsFunctions().sortContainerCustomcol(rltdatalist)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 显示容器的阴影部分
    */
  showShadowCustomContainer (tmpId) {
    BackendjsFunctions._verification('showShadowCustomContainer')
    try {
      return backendjsFunctions().showShadowCustomContainer(tmpId)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 隐藏容器的阴影部分
    */
  hideShadowCustomContainer (tmpId) {
    BackendjsFunctions._verification('hideShadowCustomContainer')
    try {
      return backendjsFunctions().hideShadowCustomContainer(tmpId)
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 隐藏所有容器的阴影部分
    */
  hideAllShadowCustomContainer () {
    BackendjsFunctions._verification('hideAllShadowCustomContainer')
    try {
      return backendjsFunctions().hideAllShadowCustomContainer()
    } catch (error) {
      console.error(error)
    }
    return null
  },
  /**
    * 容器滚动条定位
    */
  scrollCustomContainer (tmpId) {
    BackendjsFunctions._verification('scrollCustomContainer')
    try {
      return backendjsFunctions().scrollCustomContainer(tmpId)
    } catch (error) {
      console.error(error)
    }
    return null
  }
}
